/**
 * Created by zhang on 2014-11-29.
 */
// document.write()
document.write("<h1>hello html</h1>");

function insertPara(text){
    var str ="<p>";
    str += text;
    str += "</p>";
    document.write(str);
    }
insertPara("hello,javascript!");
// innerHTML()
window.onload = function() {
    var testdiv = document.getElementById('testdiv');
    alert(testdiv.innerHTML);
    testdiv.innerHTML = "<h2>Hello </h2>";
}
//DOM createElement()  createTextNode()

window.onload = function() {
    var testdiv = document.getElementById('testdiv');

    var para = document.createElement("h3");
    var txt = document.createTextNode("hello createTextNode");

    testdiv.appendChild(para);
    para.appendChild(txt);

    var info = "nodeType:";
    info += para.nodeType;
    info += "nodeName:";
    info += para.nodeName;
    alert(info);
}


